-- PaintDemoBasic.lua
-- Author: Mikael Kindborg
-- Date: 2011-02-23
-- Description: Simple paint program demo. Supports multi-touch!

-- Fill background.
maSetColorRGB(255, 255, 255)
maFillRect(0, 0, Screen.getWidth(), Screen.getHeight())
maUpdateScreen()

function Paint(x, y, touchId)
  if touchId == 0 then 
    maSetColorRGB(0, 0, 0) 
  else
    maSetColorRGB(0, 200, 0) 
  end
  maFillRect(x - 20, y - 20, 40, 40)
  maUpdateScreen()
end

System.onTouchDown(Paint)
System.onTouchDrag(Paint)
